package com.queen.restaurant.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.queen.restaurant.dao.UserDao;
import com.queen.restaurant.domain.User;

@Service("userService")
public class UserService {

	@Autowired
	private UserDao userDao;

	public void createUser(User user) throws Exception{
		userDao.save(user);
	}
	
	public User userLogin(String username){
		return userDao.getUserByName(username);
	}
	
	public User getUserById(String userId){
		return userDao.get(userId);
	}
	
	public void updateUser(User user){
		userDao.update(user);
	}
}
